# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=apk-deploy-tool
pkgver=0.5.3
pkgrel=0
pkgdesc="Tool for easily deploying applications or configuration packaged in APK via SSH"
url="https://github.com/jirutka/apk-deploy-tool"
arch="noarch"
license="MIT"
depends="
	apk-tools
	doas
	openssh-keygen
	"
pkgusers="deploy"
pkggroups="$pkgusers"
install="$pkgname.pre-install"
source="https://github.com/jirutka/apk-deploy-tool/archive/v$pkgver/$pkgname-$pkgver.tar.gz
	$pkgname.doasd
	"
options="!check"

package() {
	make install DESTDIR="$pkgdir" prefix=/usr

	cd "$pkgdir"

	install -D -m 640 "$srcdir"/$pkgname.doasd etc/doas.d/$pkgname.conf

	install -d -m 755 -o $pkgusers -g "$pkggroups" \
		var/lib/apk-deploy \
		var/lib/apk-deploy/packages
	install -d -m 700 -o $pkgusers -g "$pkggroups" \
		var/lib/apk-deploy/.ssh
}

sha512sums="
1d0e9607a10f97b357401c6d45d34f409e148ea0721161931cff03433b8486d2f974610669bb8f063a81055bc8c2348be94707fcf3ba3fc95e0d3fd7fe249ca5  apk-deploy-tool-0.5.3.tar.gz
55c3fc8c72d12ee09e7fd81c808be61340fa6657081d654396d02435a915baefe1680fca602dc434dfc5496c525894bc4031d48053c93c9bcefc7e1db969f9bb  apk-deploy-tool.doasd
"
